/**
 *게시판과 관련된 자바스크립트
 *날짜 : 2014.11
 *이름 : 안종휘 
 */
var btnList, btnInput, btnModify, btnDelete, btnView;
var url="index.jsp?inc=./score/";

function general(){//게시판에서 사용하는 공통 모듈
	btnList=document.getElementById('btnList');
	if(btnList !=null){
		btnList.onclick=function(){
			var frm=document.hiddenFrm;
			frm.action=url+"list.jsp";
			alert(frm.action);
			frm.submit();
			//location.href=url+'list.jsp';
		}
	}
	btnInput=document.getElementById('btnInput');
	if(btnInput !=null){
		btnInput.onclick=function(){
			//location.href=url+'input.jsp';
			var frm=document.hiddenFrm;
			frm.action=url+"input.jsp";
			frm.submit();
		}
	}
	btnModify=document.getElementById('btnModify');
	if(btnModify !=null){
		btnModify.onclick=function(){
			location.href=url+'modify.jsp';
		}
	}
	btnDelete=document.getElementById('btnDelete');
	if(btnDelete !=null){
		btnDelete.onclick=function(){
			var b= confirm("정말 삭제하시겠습니까?");
			if(b){
				var rno=document.hiddenFrm.rno.value;
				location.href=url+'delete_result.jsp?rno='+rno;
			}else{
				alert("삭제작업이 취소되었습니다.");
			}
			
		}
	}
	btnView=document.getElementById('btnView');
	if(btnView !=null){
		btnView.onclick=function(){
			location.href=url+'view.jsp';
		}
	}

}
function goPage(page){
	//location.href=url+"view.jsp?page="+page;
	var hf=document.hiddenFrm;
	hf.nowPage.value = page;
	hf.find.value=document.score_list_frm.find.value;
	hf.action="index.jsp?inc=./score/list.jsp";
	hf.submit();
}

function goView(page, rno){
	var hf=document.hiddenFrm;
	hf.nowPage.value = page;
	hf.rno.value=rno;
	hf.find.value=document.score_list_frm.find.value;
	hf.action="index.jsp?inc=./score/view.jsp";
	hf.submit();
}

function inputInit(){//input과 관련된 모듈
	general();
}

function listInit(){
	general();
	goPage(page);
}

function viewInit(){
	general();
}

function modifyInit(){
	general();
}

function deleteInit(){
	general();
}